package com.atguigu.gmall.product.mapper;


import com.atguigu.gmall.model.list.SearchAttr;
import com.atguigu.gmall.model.product.BaseAttrInfo;
import com.atguigu.gmall.model.product.BaseAttrValue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Entity com.atguigu.gmall.product.domain.BaseAttrInfo
 */
public interface BaseAttrInfoMapper extends BaseMapper<BaseAttrInfo> {

    List<BaseAttrInfo> getAttrInfoList(@Param("category1Id") Long category1Id,
                                       @Param("category2Id") Long category2Id,
                                       @Param("category3Id") Long category3Id);

    /**
     * 根据属性名id查名和值
     * @param attrId
     * @return
     */
    //BaseAttrInfo findAttrInfoAndValueByAttrId(Long attrId);

    /**
     * 根据属性id查值
     * @param attrId
     * @return
     */
    List<BaseAttrValue> findAttrValueListById(Long attrId);

    /**
     * 根据skuId查询出对应所有平台属性名和值,为了检索
     * @param skuId
     * @return
     */
    List<SearchAttr> getSkuBaseAttrNameAndValue(@Param("skuId") Long skuId);
}




